.class public Lcom/waiqin365/h5/util/WqOpenUrl;
.super Lorg/apache/cordova/CordovaPlugin;


# instance fields
.field a:Ljava/lang/String;

.field b:Ljava/lang/String;

.field c:Ljava/lang/String;

.field d:Ljava/lang/String;

.field private e:Lorg/apache/cordova/WqCordovaActivity;

.field private f:Lorg/apache/cordova/CallbackContext;

.field private g:Landroid/content/Intent;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->a:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->b:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->c:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->d:Ljava/lang/String;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/util/WqOpenUrl;Landroid/content/Intent;)Landroid/content/Intent;
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->g:Landroid/content/Intent;

    return-object p1
.end method

.method static synthetic a(Lcom/waiqin365/h5/util/WqOpenUrl;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->e:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/util/WqOpenUrl;)Landroid/content/Intent;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->g:Landroid/content/Intent;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 3

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->e:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->f:Lorg/apache/cordova/CallbackContext;

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->e:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, v0, Lorg/apache/cordova/WqCordovaActivity;->callbackRefresh:Lorg/apache/cordova/CallbackContext;

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->a:Ljava/lang/String;

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->a:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->e:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/util/d;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/util/d;-><init>(Lcom/waiqin365/h5/util/WqOpenUrl;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->e:Lorg/apache/cordova/WqCordovaActivity;

    const v2, 0x7f080615

    invoke-virtual {v0, v2}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p3, v0}, Lorg/apache/cordova/CallbackContext;->error(Ljava/lang/String;)V

    move v0, v1

    goto :goto_0
.end method

.method public onActivityResult(IILandroid/content/Intent;)V
    .locals 5

    invoke-super {p0, p1, p2, p3}, Lorg/apache/cordova/CordovaPlugin;->onActivityResult(IILandroid/content/Intent;)V

    const/4 v0, -0x1

    if-ne p2, v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->g:Landroid/content/Intent;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    packed-switch p1, :pswitch_data_0

    goto :goto_0

    :pswitch_0
    :try_start_0
    const-string/jumbo v0, "CORDOVA_ACTIVITY_FINISH"

    invoke-virtual {p3, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/h5/util/WqOpenUrl;->f:Lorg/apache/cordova/CallbackContext;

    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v3, "flag"

    const/4 v4, 0x1

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v2

    const-string/jumbo v3, "data"

    invoke-virtual {v2, v3, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {v1, v0}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x789
        :pswitch_0
    .end packed-switch
.end method
